<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Retenci&oacute;n de IVA</title>
<style type="text/css">
<!--
.style6 {font-size: 9.5px}
-->
</style>
<link href="boton.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style10 {font-size: 14px}
.style11 {font-size: 14px; font-weight: bold; }
body,td,th {
	font-size: 12px;
	color: #000000;
}
body {
	background-color: #FFFFFF;
}
-->
</style>
<link href="tablas.css" rel="stylesheet" type="text/css">
<link href="prueba.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style12 {font-size: 10px}
.style13 {font-family: "Times New Roman", Times, serif}
.style14 {font-size: 10px; font-family: "Times New Roman", Times, serif; }
.Estilo2 {font-size: 9px}
.Estilo3 {
	font-size: 10;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<span class="Estilo2">
<?
include 'conexion.php';
extract($_POST);
    extract($_GET);
//$base= "ucg - copia";
		$tabla = "iva";
//	$conexion=mysql_connect("localhost","root","");
//	mysql_select_db($base,$conexion);
	
	$res=mysql_query("SELECT DATE_FORMAT(fec,'%Y'), DATE_FORMAT(fec,'%m') FROM $tabla WHERE cod_iva=$Modificar",$conexion);
	$reg=mysql_fetch_row($res);
	
	$resultad=mysql_query("SELECT * FROM id_iva WHERE cod_iva=$Modificar",$conexion);
		
	$resultado=mysql_query("SELECT * FROM $tabla WHERE cod_iva=$Modificar",$conexion);
	$registro = mysql_fetch_row($resultado);	?>

<form action="insertar_iva.php" method="post" name="form1" class="Estilo2">
  <table width="100%"  border="1">
    <tr>
      <td colspan="3" ><img src="Logo%20UCG.png" width="116" height="71"></td>
      <td colspan="3" ><div align="center">RETENCI&Oacute;N DEL IMPUESTO AL VALOR AGREGADO </div></td>
    </tr>
    <tr>
      <td height="5" colspan="3"></td>
      <td width="22%" bordercolor="#000000" >NRO. COMPROBANTE &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <strong>   <? 
	     $resa=mysql_query("SELECT * FROM items WHERE nombre_item='Agente de Retencion IVA'",$conexion);
	$agente = mysql_fetch_row($resa);
	  
	 echo $reg[0].'-'.$reg[1].'-'.$agente[1].''.$registro[1];?>
      </strong></td>
      <td width="3%"></td>
      <td width="22%" align="left" bordercolor="#000000">
          1. FECHA&nbsp; <strong><? echo "$registro[2]";?></strong>
          </td>
    </tr>
    <tr>
      <td colspan="6">&nbsp;</td>
    </tr>
    <tr>
      <td width="34%" height="10%" bordercolor="#000000">2. NOMRE O RAZON SOCIAL DE AGENTE DE RETENCI&Oacute;N</td>
      <td width="3%">&nbsp;</td>
      <td colspan="2" bordercolor="#000000">3. REGISTRO DE INFORMACI&Oacute;N DEL AGENTE DE RETENCI&Oacute;N</td>
      <td>&nbsp;</td>
      <td align="left" bordercolor="#000000">4. PERIODO FISCAL</td>
    </tr>
    <tr>
      <td><span class="Estilo3"><? echo "$registro[3]";?></span></td>
      <td>&nbsp;</td>
      <td colspan="2"><span class="Estilo3"><? echo "$registro[4]";?></span></td>
      <td>&nbsp;</td>
      <td><span class="Estilo3"><? echo "$registro[5]";?></span></td>
    </tr>
    <tr>
      <td colspan="6" bordercolor="#000000">5. DIRECCI&Oacute;N FISCAL DEL AGENTE DE RETENCI&Oacute;N &nbsp;     </td>
    </tr>
    <tr>
      <td colspan="6"><span class="Estilo3"><strong><? echo "$registro[6]";?></strong></span></td>
    </tr>
    <tr>
      <td align="left" bordercolor="#000000">6. NOMBRE O RAZON SOCIAL DEL SUJETO RETENIDO</td>
      <td>&nbsp;</td>
      <td colspan="2" align="left" bordercolor="#000000">7.REGISTRO DE INFORMACI&Oacute;N FISCAL DEL SUJETO RETENIDO (RIF)</td>
      <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" bordercolor="#000000"><span class="Estilo3">
        <strong><? echo "$registro[7]";?></strong></span>
       </td>
      <td>&nbsp;</td>
      <td colspan="2" align="left" bordercolor="#000000"><span class="Estilo3"><strong><? echo "$registro[8]";?></strong> </span>      </td>
      <td colspan="2">&nbsp;</td>
    </tr>
  </table>
  <table width="100%"  border="1">
    <tr>
      <td colspan="9">&nbsp;</td>
      <td colspan="3" bordercolor="#000000">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="9">&nbsp;</td>
      <td colspan="3" bordercolor="#000000"><div align="center">COMPRAS INTERNAS O IMPORTACIONES </div></td>
      <td>&nbsp;</td>
    </tr>
    <tr bordercolor="#000000">
      <td width="4%"><div align="center" class="Estilo2">Oper N&ordm; </div></td>
      <td width="6%"><div align="center" class="Estilo2">Fecha de la Factura </div></td>
      <td width="6%"><div align="center" class="Estilo2">N&ordm; Factura </div></td>
      <td width="3%"><div align="center" class="Estilo2">N&ordm; N.D </div></td>
      <td width="3%"><div align="center" class="Estilo2">N&ordm; N.C </div></td>
      <td width="4%"><div align="center" class="Estilo2">Tipo de Trans </div></td>
      <td width="5%"><div align="center" class="Estilo2">N&ordm; de Factura Afectada </div></td>
      <td width="9%"><div align="center" class="Estilo2">Total Compras incluyendo IVA </div></td>
      <td width="6%"><div align="center" class="Estilo2">Compras sin derecho a cr&eacute;dito IVA </div></td>
      <td width="7%"><div align="center" class="Estilo2">Base Imponible </div></td>
      <td width="6%"><div align="center" class="Estilo2">% &nbsp;Alicuota</div></td>
      <td width="14%"><div align="center" class="Estilo2">Impuesto IVA </div></td>
      <td width="15%"><div align="center" class="Estilo2">IVA Retenido </div></td>
    </tr>
    <? while ($registr = mysql_fetch_row($resultad)){ ?>
    <tr bordercolor="#000000">
      <td><div align="right" class="Estilo2"><span class="celdaright"><strong><? echo "$registr[2]";?></strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? echo "$registr[3]";?> </strong></div></td>
      <td nowrap bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? echo "$registr[4]";?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? echo "$registr[5]";?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? echo "$registr[6]";
?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? echo "$registr[7]";?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? echo "$registr[8]";?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? 
	  $sum1= number_format($registr[9],2,",",".");
	  echo "$sum1"; $sum9=$sum9+$registr[9];?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? 
	  $sum2= number_format($registr[10],2,",",".");
	  echo "$sum2";$sum10=$sum10+$registr[10];?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? 
	  $sum3= number_format($registr[11],2,",",".");
	  echo "$sum3";$sum11=$sum11+$registr[11];?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? 
	  echo "$registr[12]";?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? 
	  $sum5= number_format($registr[13],2,",",".");
	  echo "$sum5"; $sum13=$sum13+$registr[13];?> </strong></div></td>
      <td bordercolor="#FFFFFF"><div align="right" class="Estilo2"><span class="celdaright"><strong> <? 
	  $sum6= number_format($registr[14],2,",",".");
	  echo "$sum6"; $sum14=$sum14+$registr[14];?> </strong></div></td>
    </tr>
    <? } ?>
    <tr bordercolor="#000000">
      <td bordercolor="#FFFFFF"><div align="right"><span class="Estilo2"><span class="Estilo2"> </div></td>
      <td bordercolor="#FFFFFF"><div align="right"><span class="Estilo2"><span class="Estilo2"></div></td>
      <td bordercolor="#FFFFFF"><div align="center"><span class="Estilo2"><span class="Estilo2"> </div></td>
      <td bordercolor="#FFFFFF"><div align="center"><span class="Estilo2"><span class="Estilo2"></div></td>
      <td bordercolor="#FFFFFF"><div align="center"><span class="Estilo2"><span class="Estilo2"></div></td>
      <td bordercolor="#FFFFFF"><div align="center"><span class="Estilo2"><span class="Estilo2"></div></td>
      <td bordercolor="#FFFFFF"><div align="center" class="Estilo2"><strong>TOTALES</strong></div></td>
      <td align="right"><div align="right" class="Estilo2">
        <span class="celdatop"><strong><? 
		$sum91= number_format($sum9,2,",",".");
		echo "$sum91";?></strong> </div></td>
      <td align="right"><div align="right" class="Estilo2"><span class="celdatop"><strong><? 
	  $sum101= number_format($sum10,2,",",".");
	  echo "$sum101";?></strong></div></td>
      <td align="right"><div align="right" class="Estilo2">
        <span class="celdatop"><strong><? 
		$sum111= number_format($sum11,2,",",".");
		echo "$sum111";?></strong> </div></td>
      <td align="right"><span class="celdatop Estilo2">&nbsp;
      <div align="right" class="Estilo2"></div></td>
      <td align="right"><div align="right" class="Estilo2">
        <span class="celdatop"><strong><? 
		$sum113= number_format($sum13,2,",",".");
		echo "$sum113";?></strong> </div></td>
      <td align="right"><div align="right" class="Estilo2">
        <span class="celdatop"><strong><? 
		$sum114= number_format($sum14,2,",",".");
		echo "$sum114";?></strong> </div></td>
    </tr>
  </table>
  <table width="100%"  border="0">
    <tr bordercolor="#000000">
      <td width="30%"><div align="center"><strong>Elaborado por: </strong></div></td>
      <td width="20%"><div align="center"><strong>Revisado por:</strong></div></td>
      <td width="20%"><div align="center"><strong>Aprobado por: </strong></div></td>
      <td width="28%"><div align="center"><strong>Recibido por: </strong></div></td>
    </tr>
    <tr bordercolor="#FFFFFF">
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr bordercolor="#FFFFFF">
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td><div align="center"><strong><? echo "$registro[13]";?></strong></div></td>
      <td><div align="center"><strong><? echo "$registro[9]";?></strong></div></td>
      <td><div align="center"><strong><? echo "$registro[10]";?></strong></div></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><div align="center"><strong>Asistente Administrativo</strong></div></td>
      <td><div align="center"><strong>Administradora</strong></div></td>
      <td><div align="center"><strong>Jefe de la Unidad</strong></div></td>
      <td>&nbsp;</td>
    </tr>
  </table>
  <p>&nbsp;</p>
</form>
</body>
</html>
